package com.song.dao.user;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.song.entity.user.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface UserDao extends BaseMapper<User> {

    /**
     * 根据账号和密码,查询用户
     * @author Song lv Jun
     * @param account 账号
     * @param password 密码
     * @return 用户实体
     */
    User selectUserByAccountAndPwd(@Param("account") String account, @Param("password") String password);

    List<User> queryUserList(Map<String, Object> map);

    int deleteUserById(int id);

    int addUser(User user);

    int batchDel(String[] array);

    int updateUserName(@Param(value = "username") String name, @Param(value = "id") int id);

    int updateUser(User user);

    User selectUserByAccount(String account);

}
